<?php

$this->pageTitle=Yii::app()->name . ' - Plano de Curso';

$this->breadcrumbs=array(
		'Turmas' => array('turma/admin'),
		$model->nome => array('turma/view&id='.$model->id),
		'Plano de Curso',
);

$this->menu=array(
	array('label'=>'Gerar Plano de Curso', 'url'=>'#', 'linkOptions'=>array('submit'=>array('imprimir','id'=>$model->id),'confirm'=>'Deseja gerar o documento de plano de curso?'),),
);
?>
<br />
<legend>
<h3 align="center">Plano de Curso</h3>
</legend>
<div class="row"><?php 
$template = "";
if(Yii::app()->session['idAtual'] == $model->responsavel_id && $model->ano >= date('Y')) {
	$template = "{delete}";
}
$this->widget('bootstrap.widgets.TbGridView',array(
			'id'=>'plano-grid',
			'pager' => array('cssFile' => Yii::app()->baseUrl . '/css/gridview.css',
					'firstPageLabel'=>'Início',
					'lastPageLabel'=>'Fim',
					'nextPageLabel'=>'Próximo >',
					'header'=>'Página Atual:',
					'prevPageLabel'=>'< Anterior',
					'maxButtonCount'=>'15',),
					'cssFile' => Yii::app()->baseUrl . '/css/gridview.css',
					'htmlOptions'=>array('class'=>'grid-view rounded'),
					'summaryText' => 'Mostrando {start}-{end} de {count} registro(s).',
					'dataProvider'=>$plano->search($model->id),
			'emptyText' => 'Nenhuma registro cadastrado para este curso',
			'columns'=>array(
					'texto',
					'tipo',
			array(
							'header' => 'Ações',
							'class' => 'CButtonColumn',
							'htmlOptions' =>array('width'=>'10px',),
							'deleteConfirmation'=>"js:'Deseja Realmente excluir este Registro do Plano de Curso?'",
							'deleteButtonImageUrl' => Yii::app()->baseUrl . '/css/' . 'gr-delete.png',
							'template' => $template,
							'buttons'=>array(

									'delete' => array(
											'url'=>'Yii::app()->controller->createUrl("planoTurma/delete", array("id"=>$data->id))',
									),
							),
						),
					),
				));

if (Yii::app()->session['idAtual'] == $model->responsavel_id && $model->ano >= date('Y')) {
$form = $this->beginWidget('CActiveForm', array(
			'id' => 'frequencia-form',
			'enableAjaxValidation' => false,
			'enableClientValidation' => true,
			'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?> 
<br />
<br />
<p>Adicionar Registro para o Plano de Curso:</p>
<div class="row"><span
	style="float: left; width: 400px; margin-left: 30px"> <?php echo $form->labelEx($plano, 'texto'); ?>
<?php echo $form->textField($plano,'texto',array('class'=>'span4','maxlength'=>250)); ?>
<?php echo $form->error($plano, 'texto'); ?> </span> <span
	style="float: left; width: 250px;"> <?php echo $form->labelEx($plano, 'tipo'); ?>
<?php echo $form->dropDownList($plano, 'tipo', Aula::$plano_tipo, array('empty' => '')); ?>
<?php echo $form->error($plano, 'tipo'); ?> </span> <span
	style="float: left; width: 50px;"> <br />
<?php $this->widget('bootstrap.widgets.TbButton', array(
				'buttonType'=>'submit',
				'type'=>'primary',
				'label' => 'Cadastrar',
				'htmlOptions' => array('class' => 'ui-button-primary')
));
?> </span></div>
<?php $this->endWidget();?></div>

<br />
<br />
<?php }?>

